package com.zhengze;

// 精确匹配
public class Demo2 {
    public static void main(String[] args) {
        // 正则表达式1
        String re1 = "abc";
        System.out.println("abc".matches(re1));  // true
        System.out.println("Abc".matches(re1));  // false

        // 正则表达式2
        String re2 = "a\\&c";
        System.out.println("a&c".matches(re2));  // true
        System.out.println("a-c".matches(re2));  // false
    }
}
